package com.laizhenghua.payment.controller;

import com.laizhenghua.commons.entity.CommonResult;
import com.laizhenghua.payment.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * @description:
 * @date: 2022/1/3 14:43
 */
@RestController
@RequestMapping(value = "/payment")
public class PaymentController {
    @Autowired
    private PaymentService paymentService;
    @Value("${server.port}")
    private String serverPort;

    @RequestMapping(value = "/zk", method = RequestMethod.GET)
    public CommonResult<Map<String, Object>> paymentZk() {
        Map<String, Object> result = new HashMap<>();
        result.put("zookeeperPort", serverPort);
        result.put("uuid", UUID.randomUUID().toString());
        return new CommonResult<>(200, "zookeeper server info", result);
    }
}
